#ifndef YNBW_HPP
#define YNBW_HPP

#include "std.hpp"
#include "YnbwException.hpp"
#include "Player.hpp"
#include "Dictionary.hpp"
#include "InternalDictionary.hpp"

class Ynbw
{
  public:
    Ynbw(Dictionary *dictionary = new InternalDictionary);
    Ynbw(const unsigned int maximumPlayers, const unsigned int minimumPlayers, Dictionary *dictionary = new InternalDictionary);
    ~Ynbw();

    int execute();

  private:
    int runGame();
    void newGame();
    void initializePlayers();
    void welcomeScreen();

    void addPlayer(Player *gamePlayer);
    bool searchForWord(const std::string line, const std::string word);
    bool proccessLine(std::string line);
    Player *whoIsWinner();
    void setPrompt(const std::string prompt);
    void displayPrompt(std::string player);
    void commonInitialization(Dictionary *dictionary);

    const unsigned int MAXIMUM_PLAYERS_;
    const unsigned int MINIMUM_PLAYERS_;
    const unsigned short WORD_COUNT_;
    unsigned int numberPlayers_;
    unsigned int playersStillIn_;
    Player **gamePlayers_;
    std::string prompt_;
    Dictionary *dictionary_;
};

#endif
